﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Emoney.UserTraining.Cache
{
    public class TrainNetwoekAndUserCache
    {
        private string keypre = "TrainNetwoekAndUserCache_";

        private string GetKey(string uid)
        {
            return keypre + uid;
        }

        public void AddCache(string uid,string content)
        {
            string key = GetKey(uid);
            News2CacheTools cache = new News2CacheTools();
            cache.Add(key, content, 2, 0, 0);
        }

        public string GetCache(string uid)
        {
            string key = GetKey(uid);
            News2CacheTools cache = new News2CacheTools();
            return cache.Get<string>(key);
        }

        public void Remove(string uid)
        {
            string key = GetKey(uid);
            News2CacheTools cache = new News2CacheTools();
            cache.Remove(key);
        }
    }
}
